function Mat = build(d)
d1=d; d2=d;
[I1,J1,K1] = indices(d1);
[I2,J2,K2] = indices(d2);
m1 = (d1+1)*(d1+2)/2;
m2 = (d2+1)*(d2+2)/2;
Mat = zeros(m1,m2);
for j = 1:m2
   for i = 1:m1
      Mat(i,j) = prod(1:(I1(i)+I2(j)))*prod(1:(J1(i)+J2(j)))*prod(1:(K1(i)+K2(j)))/...
          (prod(1:I1(i))*prod(1:I2(j))*prod(1:J1(i))*prod(1:J2(j))*prod(1:K1(i))*prod(1:K2(j)));
   end;
end;
Mat = 2*(prod(1:d1)*prod(1:d2)/prod(1:(d1+d2+2)))*Mat;